package com.xqboss.apps.controller.guild;

import cn.hutool.core.util.ObjUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xqboss.apps.dto.PageDto;
import com.xqboss.apps.dto.guild.GuildCreateDto;
import com.xqboss.apps.dto.guild.GuildMemberDto;
import com.xqboss.apps.dto.guild.GuildRecommendDto;
import com.xqboss.apps.service.guild.GuildAppService;
import com.xqboss.apps.vo.guild.*;
import com.xqboss.common.annotation.EnumValue;
import com.xqboss.common.annotation.RepeatSubmit;
import com.xqboss.common.constant.HttpStatus;
import com.xqboss.common.core.controller.BaseController;
import com.xqboss.common.core.domain.PageResult;
import com.xqboss.common.core.domain.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.validator.constraints.Length;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.util.List;

@Slf4j
@Validated
@Api(tags = "公会")
@RestController
@RequestMapping("guild")
public class GuildController extends BaseController {

    @Autowired
    private GuildAppService guildService;

    @ApiOperation("推荐公会列表")
    @GetMapping("/recommend")
    public PageResult<GuildRecommendVo> guildRecommendList(@Validated GuildRecommendDto<GuildRecommendVo> dto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            IPage<GuildRecommendVo> vo = this.guildService.guildRecommendList(dto,loginUserId);
            log.info("[guildRecommendList]推荐公会列表获取成功-用户ID：{}",loginUserId);
            return PageResult.ok(vo,"推荐公会列表获取成功");
        }catch (Exception e){
            log.error("[guildRecommendList]推荐公会列表获取失败-用户ID：{}",loginUserId,e);
            return PageResult.fail(e.getMessage());
        }
    }

    @ApiOperation("红点提示-【邀请我的】存在待处理邀请记录时显示")
    @GetMapping("/isHaveApprove")
    public R<Boolean> isHaveApprove(){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            boolean isHaveApprove = this.guildService.isHaveApprove(loginUserId);
            log.info("[guildRecommendList]红点提示获取成功-用户ID：{}",loginUserId);
            return R.ok(isHaveApprove,"红点提示获取成功");
        }catch (Exception e){
            log.error("[guildRecommendList]红点提示获取失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("创建公会判断")
    @GetMapping("/create-judge")
    public R<String> createGuildJudge(){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            GuildCreateConsumeVo vo = this.guildService.createGuildJudge(loginUserId);
            log.info("[createGuildJudge]创建公会判断成功-用户ID：{}",loginUserId);
            return R.ok_msg("满足创建公会条件~");
        }catch (Exception e){
            log.error("[createGuildJudge]创建公会判断失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("管理公会详情")
    @GetMapping("/manage")
    public R<GuildCreateVo> manageGuildDetail(){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            GuildCreateVo vo = this.guildService.manageGuildDetail(loginUserId);
            log.info("[manageGuildDetail]获取管理公会详情成功-用户ID：{}",loginUserId);
            return R.ok(vo,"获取管理公会详情成功");
        }catch (Exception e){
            log.error("[manageGuildDetail]获取管理公会详情失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("公会名称校验")
    @GetMapping("/check/{guildName}")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> checkGuildName(@ApiParam(name = "guildName",value = "公会名称",required = true)
                                    @Length(min = 1,max = 6,message = "公会名称最多输入6个字")
                                    @PathVariable(name = "guildName") String guildName){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.checkGuildName(URLDecoder.decode(guildName, StandardCharsets.UTF_8.name()),loginUserId);
            log.info("[checkGuildName]公会名称校验成功-用户ID：{}",loginUserId);
            return R.ok_msg("公会名称校验成功");
        }catch (Exception e){
            log.error("[checkGuildName]公会名称校验失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("创建公会（确认创建-若后台配置了消耗材料，会返回材料信息;若返回的材料信息为null，则后台未配置材料消耗，直接创建公会成功")
    @PostMapping("/create-confirm")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<GuildCreateConsumeVo> createGuildConfirm(@Validated @RequestBody GuildCreateDto dto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            GuildCreateConsumeVo vo = this.guildService.createGuildConfirm(dto,loginUserId);
            if (ObjUtil.isEmpty(vo)) {
                log.info("[createGuild]创建公会成功-用户ID：{}",loginUserId);
                return R.ok_msg("创建公会成功~");
            }else{
                log.info("[createGuild]创建公会需要消耗材料-用户ID：{}",loginUserId);
                //"创建公会需要消耗材料~"
                return R.ok(vo, HttpStatus.CREATE_GUILD_CONSUME,null);
            }
        }catch (Exception e){
            log.error("[createGuild]创建公会失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("创建公会（确认-消耗材料")
    @PostMapping("/create-consume")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> createGuildConfirmConsume(@Validated @RequestBody GuildCreateDto dto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.createGuildConfirmConsume(dto,loginUserId);
            log.info("[createGuild]创建公会和消耗成功-用户ID：{}",loginUserId);
            return R.ok_msg("创建公会成功~");
        }catch (Exception e){
            log.error("[createGuild]创建公和消耗会失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("申请加入公会（加入公会-若需要消耗材料，会返回要消耗的材料信息）")
    @GetMapping("/join-apply/{guildId}")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<Object> applyJoinGuild(@PathVariable(name = "guildId",required = true)
                                              @ApiParam(name = "guildId",value = "公会id",required = true)
                                              @NotNull(message = "公会id不能为空") Long guildId){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            return this.guildService.applyJoinGuild(guildId,loginUserId);
        }catch (Exception e){
            log.error("[applyJoinGuild]申请加入公会失败-用户ID：{}，公会ID：{}",loginUserId,guildId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("申请加入公会消耗（确认-加入公会-消耗材料")
    @GetMapping("/join-apply-consume/{guildId}")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<Object> applyJoinGuildConfirmConsume(@PathVariable(name = "guildId",required = true)
                                             @ApiParam(name = "guildId",value = "公会id",required = true)
                                             @NotNull(message = "公会id不能为空") Long guildId){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            R<Object> r = this.guildService.applyJoinGuildConfirmConsume(guildId, loginUserId, Boolean.FALSE);
            log.info("[applyJoinGuildConfirmConsume]申请加入公会消耗成功-用户ID：{}，公会ID：{},信息：{}",loginUserId,guildId,r.getMsg());
            return r;
        }catch (Exception e){
            log.error("[applyJoinGuildConfirmConsume]申请加入公会消耗失败-用户ID：{}，公会ID：{}",loginUserId,guildId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("申请记录-我的申请")
    @GetMapping("/record-apply")
    public PageResult<GuildMyApplyRecordVo> myApplyRecord(@Validated PageDto<GuildMyApplyRecordVo> dto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            IPage<GuildMyApplyRecordVo> vo = this.guildService.myApplyRecord(dto.newPage(),loginUserId);
            log.info("[myApplyRecord]我的申请获取成功-用户ID：{}",loginUserId);
            return PageResult.ok(vo,"我的申请获取成功");
        }catch (Exception e){
            log.error("[myApplyRecord]我的申请获取失败-用户ID：{}",loginUserId,e);
            return PageResult.fail(e.getMessage());
        }
    }

    @ApiOperation("申请记录-邀请我的")
    @GetMapping("/record-invite")
    public PageResult<GuildInviteMeRecordVo> inviteMeRecord(@Validated PageDto<GuildInviteMeRecordVo> dto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            IPage<GuildInviteMeRecordVo> vo = this.guildService.inviteMeRecord(dto.newPage(),loginUserId);
            log.info("[inviteMeRecord]邀请我的获取成功-用户ID：{}",loginUserId);
            return PageResult.ok(vo,"邀请我的获取成功");
        }catch (Exception e){
            log.error("[inviteMeRecord]邀请我的获取失败-用户ID：{}",loginUserId,e);
            return PageResult.fail(e.getMessage());
        }
    }

    @ApiOperation("加入公会（邀请我的）-会员操作，若后台配置了需要消耗材料，则返回对应的材料信息，否则直接加入成功）")
    @GetMapping("/join-invite")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<Object> joinInviteGuild(@RequestParam(name = "guildId",required = true)
                               @ApiParam(name = "guildId",value = "公会id",required = true)
                               @NotNull(message = "公会id不能为空") Long guildId,
                               @RequestParam(name = "status",required = true)
                               @ApiParam(name = "status",value = "处理状态（1-通过 3-拒绝）",required = true)
                               @NotNull(message = "处理状态不能为空")
                               @EnumValue(intValues = {1,3},message = "处理状态只能是：（1-通过 3-拒绝）") Integer status){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            return this.guildService.joinInviteGuild(guildId,status,loginUserId);
        }catch (Exception e){
            log.error("[joinInviteGuild]操作邀请我的公会状态失败-用户ID：{}，公会id：{}",loginUserId,guildId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("邀请加入公会消耗（确认-加入公会-消耗材料")
    @GetMapping("/join-invite-consume/{guildId}")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<Object> inviteJoinGuildConfirmConsume(@PathVariable(name = "guildId",required = true)
                                                  @ApiParam(name = "guildId",value = "公会id",required = true)
                                                  @NotNull(message = "公会id不能为空") Long guildId){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            R<Object> r = this.guildService.inviteJoinGuildConfirmConsume(guildId, loginUserId, Boolean.FALSE);
            log.info("[inviteJoinGuildConfirmConsume]邀请加入公会消耗成功-用户ID：{}，公会ID：{},信息：{}",loginUserId,guildId,r.getMsg());
            return r;
        }catch (Exception e){
            log.error("[inviteJoinGuildConfirmConsume]邀请加入公会消耗失败-用户ID：{}，公会ID：{}",loginUserId,guildId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("公会首页信息")
    @GetMapping("/index")
    public R<GuildVo> guildIndexInfo(){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            GuildVo vo = this.guildService.guildIndexInfo(loginUserId);
            log.info("[guildIndexInfo]公会首页信息获取成功-用户ID：{}",loginUserId);
            return R.ok(vo,"公会首页信息获取成功");
        }catch (Exception e){
            log.error("[guildIndexInfo]公会首页信息获取失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("加入申请列表（会员申请公会的记录）")
    @GetMapping("/join-apply-list")
    public PageResult<GuildJoinApplyRecordVo> joinApplyList(@Validated PageDto<GuildJoinApplyRecordVo> dto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            IPage<GuildJoinApplyRecordVo> vo = this.guildService.joinApplyList(dto.newPage(),loginUserId);
            log.info("[joinApplyList]加入申请列表获取成功-用户ID：{}",loginUserId);
            return PageResult.ok(vo,"加入申请列表获取成功");
        }catch (Exception e){
            log.error("[joinApplyList]加入申请列表获取失败-用户ID：{}",loginUserId,e);
            return PageResult.fail(e.getMessage());
        }
    }

    @ApiOperation("审核（加入申请）-会长操作）")
    @GetMapping("/examine")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> examineGuildMember(@RequestParam(name = "userId",required = true)
                               @ApiParam(name = "userId",value = "审核的用户id",required = true)
                               @NotNull(message = "审核的用户id不能为空") Long userId,
                               @RequestParam(name = "status",required = true)
                               @ApiParam(name = "status",value = "处理状态（1-通过 3-拒绝）",required = true)
                               @NotNull(message = "处理状态不能为空")
                               @EnumValue(intValues = {1,3},message = "处理状态只能是：（1-通过 3-拒绝）") Integer status){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            String msg = this.guildService.examineGuildMember(userId,status,loginUserId);
            log.info("[examineGuildMember]审核{}成功-审核用户ID：{}，被审核用户ID：{}",msg,loginUserId,userId);
            return R.ok_msg(msg);
        }catch (Exception e){
            log.error("[examineGuildMember]审核失败-审核用户ID：{}，被审核用户ID：{}",loginUserId,userId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("公会大厅-公会信息")
    @GetMapping("/hall-guild")
    public R<GuildHallVo> guildHallInfo(){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            GuildHallVo vo = this.guildService.guildHallInfo(loginUserId);
            log.info("[guildHallInfo]公会大厅公会信息获取成功-用户ID：{}",loginUserId);
            return R.ok(vo,"公会大厅公会信息获取成功");
        }catch (Exception e){
            log.error("[guildHallInfo]公会大厅公会信息获取成功-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("公会大厅-成员列表")
    @GetMapping("/hall-members")
    public PageResult<GuildMemberVo> guildHallMembers(@Validated GuildMemberDto<GuildMemberVo> dto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            IPage<GuildMemberVo> vos = this.guildService.guildHallMemberss(dto,loginUserId);
            log.info("[guildHallMembers]公会大厅成员列表获取成功-用户ID：{}",loginUserId);
            return PageResult.ok(vos,"公会大厅成员列表获取成功");
        }catch (Exception e){
            log.error("[guildHallMembers]公会大厅成员列表获取失败-用户ID：{}",loginUserId,e);
            return PageResult.fail(e.getMessage());
        }
    }

    @ApiOperation("退出公会（会员操作）")
    @GetMapping("/exit")
    public R<String> memberExitGuild(){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.memberExitGuild(loginUserId);
            log.info("[memberExitGuild]退出公会成功-用户ID：{}",loginUserId);
            return R.ok_msg("退出公会成功");
        }catch (Exception e){
            log.error("[memberExitGuild]退出公会失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("踢出公会（会长操作）")
    @GetMapping("/kick/{userId}")
    public R<String> memberKickGuild(@PathVariable("userId")
                                     @ApiParam(value = "被请出的用户id", required = true)
                                     @NotNull(message = "被请出的用户id不能为空！") Long userId){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.memberKickGuild(userId,loginUserId);
            log.info("[memberKickGuild]踢出公会成功-用户ID：{}",userId);
            return R.ok_msg("已请出公会~");
        }catch (Exception e){
            log.error("[memberKickGuild]踢出公会失败-用户ID：{}",userId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("公会名称编辑（会长操作）")
    @GetMapping("/edit-name/{guildName}")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> editGuildName(@ApiParam(name = "guildName",value = "公会名称",required = true)
                                   @Length(min = 1,max = 6,message = "公会名称最多输入6个字")
                                   @PathVariable(name = "guildName")String guildName){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.editGuildName(URLDecoder.decode(guildName, StandardCharsets.UTF_8.name()),loginUserId);
            log.info("[editGuildName]公会名称编辑成功-用户ID：{}",loginUserId);
            return R.ok_msg("公会名称修改成功~");
        }catch (Exception e){
            log.error("[editGuildName]公会名称编辑失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("公会宣言编辑（会长操作）")
    @GetMapping("/edit-manifesto/{manifesto}")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> editGuildManifesto(@ApiParam(name = "manifesto",value = "公会宣言",required = true)
                                        @Length(min = 1,max = 20,message = "公会名称最多输入20个字")
                                        @PathVariable(name = "manifesto")
                                                    String manifesto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.editGuildManifesto(URLDecoder.decode(manifesto, StandardCharsets.UTF_8.name()),loginUserId);
            log.info("[editGuildName]公会宣言编辑成功-用户ID：{}",loginUserId);
            return R.ok_msg("公会宣言编辑成功");
        }catch (Exception e){
            log.error("[editGuildName]公会宣言编辑失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("公会是否开启审核（会长操作）-默认开启")
    @GetMapping("/edit-verify/{isNeedVerify}")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> editGuildVerify(@ApiParam(name = "manifesto",value = "公会是否开启审核（0-关闭 1-开启）",required = true)
                                        @PathVariable(name = "isNeedVerify")
                                        @EnumValue(intValues = {0,1},message = "处理状态只能是：（0-关闭 1-开启）") Integer isNeedVerify){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.editGuildVerify(isNeedVerify,loginUserId);
            log.info("[editGuildVerify]公会是否开启审核-用户ID：{}",loginUserId);
            return R.ok_msg("公会"+(isNeedVerify==1?"开启":"关闭")+"审核成功");
        }catch (Exception e){
            log.error("[editGuildVerify]公会是否开启审核-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("邀请会员列表")
    @GetMapping("/invite-members")
    public PageResult<GuildInviteMemberVo> inviteMembersList(@Validated GuildMemberDto<GuildInviteMemberVo> dto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            IPage<GuildInviteMemberVo> vo = this.guildService.inviteMembersList(dto,loginUserId);
            log.info("[inviteMembersList]邀请会员列表获取成功-用户ID：{}",loginUserId);
            return PageResult.ok(vo,"邀请会员列表获取成功");
        }catch (Exception e){
            log.error("[inviteMembersList]邀请会员列表获取失败-用户ID：{}",loginUserId,e);
            return PageResult.fail(e.getMessage());
        }
    }

    @ApiOperation("邀请会员（会长操作）")
    @PostMapping("/invite")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> inviteMembers(@Size(min = 1,message = "请至少选择一个要邀请的会员") @ApiParam(name = "userIds",value = "用户id数组",required = true) @RequestBody List<String> userIds){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.inviteMembers(userIds,loginUserId);
            log.info("[inviteMembers]邀请会员成功-用户ID：{}",loginUserId);
            return R.ok_msg("邀请会员成功");
        }catch (Exception e){
            log.error("[inviteMembers]邀请会员失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("解散公会（会长操作）")
    @PostMapping("/dissolve")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> dissolveGuild(){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.dissolveGuild(loginUserId);
            log.info("[dissolveGuild]解散公会成功-用户ID：{}",loginUserId);
            return R.ok_msg("解散公会成功");
        }catch (Exception e){
            log.error("[dissolveGuild]解散公会失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("转让公会-会员列表（不包括会长）")
    @GetMapping("/transfers")
    public PageResult<GuildTransferMemberVo> transferMembersList(@Validated GuildMemberDto<GuildTransferMemberVo> dto){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            IPage<GuildTransferMemberVo> vo = this.guildService.transferMembersList(dto,loginUserId);
            log.info("[transferMembersList]转让公会-会员列表获取成功-用户ID：{}",loginUserId);
            return PageResult.ok(vo,"转让公会-会员列表获取成功");
        }catch (Exception e){
            log.error("[transferMembersList]转让公会-会员列表获取失败-用户ID：{}",loginUserId,e);
            return PageResult.fail(e.getMessage());
        }
    }

    @ApiOperation("转让公会（会长操作）")
    @GetMapping("/transfer/{userId}")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> transferGuild(@PathVariable("userId")
                                   @ApiParam(value = "转让的用户id", required = true)
                                   @NotNull(message = "转让的用户id不能为空！") Long userId){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.transferGuild(userId,loginUserId);
            log.info("[transferGuild]转让公会成功-用户ID：{}",loginUserId);
            return R.ok_msg("会长权限已转让~");
        }catch (Exception e){
            log.error("[transferGuild]转让公会失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }

    @ApiOperation("消息推送弹窗暂时关闭")
    @GetMapping("/closeSocketMsg/{userId}")
    @RepeatSubmit(interval = 1000, justUrl = true)
    public R<String> closeSocketMsg(@PathVariable("userId")
                                   @ApiParam(value = "用户id", required = true)
                                   @NotNull(message = "用户id不能为空！") Long userId){
        Long loginUserId = null;
        try {
            loginUserId = getUserId();
            this.guildService.closeSocketMsg(userId);
            log.info("[closeSocketMsg]消息推送弹窗暂时关闭成功-用户ID：{}",loginUserId);
            return R.ok_msg("消息推送弹窗已关闭~");
        }catch (Exception e){
            log.error("[closeSocketMsg]消息推送弹窗暂时关闭失败-用户ID：{}",loginUserId,e);
            return R.fail(e.getMessage());
        }
    }
}
